Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Grade Calculator (v1) #246

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Implement Grade Calculator (v1) #246

wants to merge 21 commits into from

Conversation

rahulon12
Copy link
Member

@rahulon12 rahulon12 commented Feb 25, 2025

Fixes #245

Changes Made

  • Implement a basic grade calculator, with the ability to create, add assignments and assignment groups. See score update live.
  • Currently uses the groups and weights in the Canvas course, editable by the user.
  • Reorder assignments and groups.
  • Designs need refinement, but will be done iteratively over time.
  • Future: Save edited user configuration of weights & assignments

Screenshots (if applicable)

Simulator Screenshot - iPhone 16 Pro - 2025-03-01 at 13 43 01 Simulator Screenshot - iPhone 16 Pro - 2025-03-01 at 13 42 57 Screenshot 2025-03-01 at 1 41 57 PM Screenshot 2025-03-01 at 1 41 44 PM

Checklist

  • I have implemented all requirements for this PR and its accompanying issue.
  • I have verified my implementation across all edge cases.
  • I have ensured my changes compile on macOS & iOS.
  • I have resolved all SwiftLint warnings.

@rahulon12 rahulon12 force-pushed the rahul/grade_calc branch 3 times, most recently from ba3ca0e to 1f566f2 Compare March 1, 2025 18:41
@rahulon12 rahulon12 marked this pull request as ready for review March 1, 2025 18:50
@rahulon12 rahulon12 requested review from azooz2003-bit, MJFree34 and iwatger and removed request for azooz2003-bit, MJFree34 and iwatger March 1, 2025 18:50
@rahulon12
Copy link
Member Author

Please extensively test the calculator's math!

@rahulon12 rahulon12 changed the title Rahul/grade calc Implement Grade Calculator (v1) Mar 1, 2025
@rahulon12
Copy link
Member Author

To do: displaying rules in the grade calc

@iwatger
Copy link
Contributor

iwatger commented Mar 2, 2025

Screenshot 2025-03-01 at 8 03 28 PM

Can you make the sheet width adjustable? I have some grades that are 2+ digits in length, and i get a ... truncation with my current screen resolution/font size

@iwatger
Copy link
Contributor

iwatger commented Mar 2, 2025

Screenshot 2025-03-01 at 8 16 48 PM

Is there a way to remove pre-existing or added assignments?

@rahulon12
Copy link
Member Author

Screenshot 2025-03-01 at 8 16 48 PM Is there a way to remove pre-existing or added assignments?

Added. There was an issue with deleting groups, will add in a later iteration

@rahulon12
Copy link
Member Author

Screenshot 2025-03-01 at 8 03 28 PM Can you make the sheet width adjustable? I have some grades that are 2+ digits in length, and i get a ... truncation with my current screen resolution/font size

I've fixed the textfield width, although it's not as nicely aligned now.

@mko02
Copy link
Contributor

mko02 commented Mar 2, 2025

Screen.Recording.2025-03-02.at.4.45.22.PM.mov

Double clicking doesn't seem to allow editing, only single clicking works. My institution to edit is to double click not single click, but that may just be me

@mko02
Copy link
Contributor

mko02 commented Mar 2, 2025

Screenshot 2025-03-02 at 4 47 44 PM

Minimizing the screen makes the pop up exceed the application

@mko02
Copy link
Contributor

mko02 commented Mar 2, 2025

Screen.Recording.2025-03-02.at.4.49.19.PM.mov

Updating the percentage for the first time causes a glitch, the cursor should be before the %? There's no glitch if I edit it again. 1%2 is treated as 1%

@mko02
Copy link
Contributor

mko02 commented Mar 2, 2025

Screen.Recording.2025-03-02.at.4.51.37.PM.mov

adding more than 2 digits for the weight percentage causes the same glitch as above

@mko02
Copy link
Contributor

mko02 commented Mar 2, 2025

Screenshot 2025-03-02 at 4 56 48 PM

The grade calculation right now is weighing each assignment based on the amount of points? I know some classes weigh each assignments equally, even though the pointsPossible is different. Could there be maybe an option to switch between the two formats?

@rahulon12
Copy link
Member Author

Screen.Recording.2025-03-02.at.4.45.22.PM.mov

Double clicking doesn't seem to allow editing, only single clicking works. My institution to edit is to double click not single click, but that may just be me

I agree, but this is SwiftUI's default behavior :/

@rahulon12
Copy link
Member Author

Screen.Recording.2025-03-02.at.4.49.19.PM.mov

Updating the percentage for the first time causes a glitch, the cursor should be before the %? There's no glitch if I edit it again. 1%2 is treated as 1%

This is a SwiftUI glitch when using the percent format for TextField. I just resorted to using a separate Text with "%", so it should be fixed now!

@rahulon12
Copy link
Member Author

Screenshot 2025-03-02 at 4 56 48 PM The grade calculation right now is weighing each assignment based on the amount of points? I know some classes weigh each assignments equally, even though the `pointsPossible` is different. Could there be maybe an option to switch between the two formats?

Yeah, we can do that in a future iteration. I'll create an issue for it. Right now the aim is to get the same "grade" value you get on Canvas

@rahulon12
Copy link
Member Author

Screenshot 2025-03-02 at 4 47 44 PM Minimizing the screen makes the pop up exceed the application

I'd consider this "expected" according to HIG

@azooz2003-bit
Copy link
Contributor

@rahulon12 Why is the textfield selection so slow?

CleanShot 2025-03-05 at 22 27 43

@rahulon12
Copy link
Member Author

@rahulon12 Why is the textfield selection so slow?

CleanShot 2025-03-05 at 22 27 43 CleanShot 2025-03-05 at 22 27 43

I looked into this, and it seems like a SwiftUI limitation when there are several text fields being rendered 😭

However, I believe there are ways to get around it, which will require refactoring. I will create a new umbrella issue with all the enhancements/perf issues that are mentioned by everyone in this PR. For the scope of this PR, I hope to focus on functionality and major bugs/code design.

@MJFree34
Copy link
Contributor

I've been playing with it for a bit. A few things:

  1. Shouldn't the current score on the main grades page be a percentage?
    CleanShot 2025-03-11 at 01 48 57
  2. What if we had the "Add Assignment" assignment have the same base points as others in the category? Like in this one, we could have it populate automatically with 100 points.
    CleanShot 2025-03-11 at 01 50 21
  3. It's a bit hard to realize how to delete assignments I create on mac. Instead of just swipe action we should also have it appear in the right click menu.
  4. May just be me, but it's quite hard to see the icon for "Calculate Grades" button in much detail. I don't know if there is an SF Symbol that works besides the +/- symbol, but just a thought. Maybe ping the designers and see what they think?

I notoriously don't have like any grades except for that one course I played with so I don't have many schemes I was able to do with real data––just playing with the weightings of each course. It all seemed to work pretty solid with just the thoughts above!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Standard Grade Calculator
5 participants